subroutine simpson_1_per_3(a, b, n, I, fungsi)
	implicit none
	double precision a, b, I, fungsi
	integer*2 n
	double precision h, x, sigma
	integer*2 r
	
	h = (b-a)/n
	print*,"h = ",h
	x = a
	I = fungsi(a) + fungsi(b)
	sigma = 0
	r = 1
	while (r<=(n-1)) do
		x = x + h
		if (mod(r,2).eq.1) then
			sigma = sigma + 4*fungsi(x)
		else
			sigma = sigma + 2*fungsi(x)
		end if
		r = r + 1
	end do
	print*,"I+sigma = ",(I+sigma)
	I = (I+sigma)*h/3
end